<template>
  <div>
    <div>{{date|formatDate('YYYY-MM-DD')}}</div>
  </div>
</template>

<script>
import API from '@/api/filters'
export default {
  name: 'filters',
  data () {
    return {
      date: null
    }
  },
  methods: {
    formatDate () {
      API.formatDate().then(res => {
        this.date = new Date(res.result)
      }).catch(e => {
        this.$message.error(`error:${e.message}`)
      })
    }
  },
  mounted () {
    this.formatDate()
  }
}
</script>
